home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 4 / boot-disc-1996-12.iso / Apps / Cakewalk / PROAUD5 / AD.1 / Scale Velocity.cal < prev    next >
Text File  |  1996-06-18  |  553b  |  28 lines

  1. ;; Scale Velocity.cal
  2. ;;
  3. ;; This is a sample CAL program that implements an editing command to
  4. ;; scale note velocities by a certain percentage.
  5. ;;
  6. ;; Demonstrates:
  7. ;;
  8. ;;   (forEachEvent)
  9. ;;   Getting input from the user
  10. ;;   Arithmetic operators
  11. ;;   Event kind and parameter variables
  12.  
  13. (do
  14.     (include "need20.cal")    ; Require version 2.0 or higher of CAL
  15.  
  16.     (int percent 100)
  17.     (getInt percent "Percentage?" 1 1000)
  18.  
  19.     (forEachEvent
  20.         (if (== Event.Kind NOTE)
  21.             (do
  22.                 (*= Note.Vel percent)
  23.                 (/= Note.Vel 100)
  24.             )
  25.         )
  26.     )
  27. )
  28.